home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / wais / waisgate / zprot.h < prev    next >
C/C++ Source or Header  |  1995-05-09  |  6KB  |  182 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.    
  4.   
  5.    3.26.90    Harry Morris, morris@think.com
  6.    3.30.90  Harry Morris - Changed any->bits to any->bytes
  7. */
  8.  
  9. #ifndef _H_Z39_50
  10.  
  11. #define _H_Z39_50
  12.  
  13. #include "cdialect.h"
  14.  
  15. #include "zutil.h"
  16.  
  17. /*----------------------------------------------------------------------*/
  18. /* APDU types */
  19.  
  20. typedef struct InitAPDU {
  21.     pdu_type        PDUType;
  22.     boolean            willSearch,willPresent,willDelete;
  23.     boolean            supportAccessControl,supportResourceControl;
  24.     long            PreferredMessageSize;
  25.     long            MaximumRecordSize;
  26.     char*            IDAuthentication;
  27.     char*            ImplementationID;
  28.     char*             ImplementationName;
  29.     char*            ImplementationVersion;
  30.     any*            ReferenceID;
  31.     void*            UserInformationField;
  32.     } InitAPDU;
  33.  
  34. typedef struct InitResponseAPDU {
  35.     pdu_type        PDUType;
  36.     boolean            Result;
  37.     boolean            willSearch,willPresent,willDelete;
  38.     boolean            supportAccessControl,supportResourceControl;
  39.     long            PreferredMessageSize;
  40.     long             MaximumRecordSize;
  41.     char*            IDAuthentication;
  42.     char*            ImplementationID;
  43.     char*             ImplementationName;
  44.     char*            ImplementationVersion;
  45.     any*            ReferenceID;
  46.     void*            UserInformationField;
  47.     } InitResponseAPDU;
  48.  
  49. typedef struct SearchAPDU {
  50.     pdu_type        PDUType;
  51.     long             SmallSetUpperBound;
  52.     long            LargeSetLowerBound;
  53.     long             MediumSetPresentNumber;
  54.     boolean         ReplaceIndicator;
  55.     char*            ResultSetName;
  56.     char**            DatabaseNames;   
  57.     char*            QueryType;
  58.     char**            ElementSetNames;  
  59.     any*            ReferenceID;
  60.     void*            Query;
  61.     } SearchAPDU;
  62.  
  63. typedef struct SearchResponseAPDU {
  64.     pdu_type        PDUType;
  65.     long            SearchStatus;
  66.     long            ResultCount;
  67.     long            NumberOfRecordsReturned;
  68.     long             NextResultSetPosition;
  69.     long            ResultSetStatus;
  70.     long             PresentStatus;
  71.     any*            ReferenceID;
  72.     void*            DatabaseDiagnosticRecords;
  73.     } SearchResponseAPDU;
  74.  
  75. typedef struct PresentAPDU {
  76.     pdu_type        PDUType;
  77.     long            NumberOfRecordsRequested;
  78.     long            ResultSetStartPosition;
  79.     char*             ResultSetID;
  80.     char*            ElementSetNames;
  81.     any*            ReferenceID;
  82.     void*            PresentInfo;
  83.     } PresentAPDU;
  84.  
  85. typedef struct PresentResponseAPDU {
  86.     pdu_type        PDUType;
  87.     boolean            PresentStatus;
  88.     long            NumberOfRecordsReturned;
  89.     long            NextResultSetPosition;
  90.     any*            ReferenceID;
  91.     void*            DatabaseDiagnosticRecords;
  92.     } PresentResponseAPDU;
  93.  
  94. /*----------------------------------------------------------------------*/
  95. /* Functions */
  96.  
  97. #ifdef __cplusplus
  98. /* declare these as C style functions */
  99. extern "C"
  100.     {
  101. #endif /* def __cplusplus */
  102.  
  103. InitAPDU* makeInitAPDU _AP((boolean search,boolean present,boolean deleteIt,
  104.                 boolean accessControl,boolean resourceControl,
  105.                 long prefMsgSize,long maxMsgSize,
  106.                 char* auth,char* id,char* name, char* version,
  107.                 any* refID,void* userInfo));
  108. void freeInitAPDU _AP((InitAPDU* init));
  109. char* writeInitAPDU _AP((InitAPDU* init,char* buffer,long* len));
  110. char* readInitAPDU _AP((InitAPDU** init,char* buffer));
  111.  
  112.  
  113. InitResponseAPDU* makeInitResponseAPDU _AP((boolean result,
  114.                         boolean search,boolean present,boolean deleteIt,
  115.                         boolean accessControl,boolean resourceControl,
  116.                         long prefMsgSize,long maxMsgSize,
  117.                         char* auth,char* id,char* name, char* version,
  118.                         any* refID,void* userInfo));
  119. void freeInitResponseAPDU _AP((InitResponseAPDU* init));
  120. char* writeInitResponseAPDU _AP((InitResponseAPDU* init,char* buffer,long* len));
  121. char* readInitResponseAPDU _AP((InitResponseAPDU** init,char* buffer));
  122. InitResponseAPDU* replyToInitAPDU _AP((InitAPDU* init,boolean result,void* userInfo));
  123.  
  124. SearchAPDU* makeSearchAPDU _AP((long small,long large, long medium,
  125.                 boolean replace,char* name,char** databases,
  126.                 char* type,char** elements,any* refID,void* queryInfo));
  127. void freeSearchAPDU _AP((SearchAPDU* query));
  128. char* writeSearchAPDU _AP((SearchAPDU* query,char* buffer,long* len));
  129. char* readSearchAPDU _AP((SearchAPDU** query,char* buffer));
  130.  
  131. SearchResponseAPDU* makeSearchResponseAPDU _AP((long result,long count,
  132.                         long recordsReturned,long nextPos,
  133.                         long resultStatus,long presentStatus,
  134.                         any* refID,void* records));
  135. void freeSearchResponseAPDU _AP((SearchResponseAPDU* queryResponse));
  136. char* writeSearchResponseAPDU _AP((SearchResponseAPDU* queryResponse,char* buffer,long* len));
  137. char* readSearchResponseAPDU _AP((SearchResponseAPDU** queryResponse,char* buffer));
  138.  
  139. PresentAPDU* makePresentAPDU _AP((long recsReq, long startPos,
  140.                   char* resultID,any* refID,void* info));
  141. void freePresentAPDU _AP((PresentAPDU* present));
  142. char* writePresentAPDU _AP((PresentAPDU* present,char* buffer,long* len));
  143. char* readPresentAPDU _AP((PresentAPDU** present,char* buffer));
  144.  
  145. PresentResponseAPDU* makePresentResponseAPDU _AP((boolean status,long recsRet,
  146.                           long nextPos,any* refID,
  147.                           void* records));
  148. void freePresentResponseAPDU _AP((PresentResponseAPDU* present));
  149. char* writePresentResponseAPDU _AP((PresentResponseAPDU* present,char* buffer,long* len));
  150. char* readPresentResponseAPDU _AP((PresentResponseAPDU** present,char* buffer));
  151.  
  152. /*----------------------------------------------------------------------*/
  153. /* user extension hooks: */
  154.  
  155. extern char* writeInitInfo _AP((InitAPDU* init,char* buffer,long* len));
  156. extern char* readInitInfo _AP((void** info,char* buffer));
  157.  
  158. extern char* writeInitResponseInfo _AP((InitResponseAPDU* init,char* buffer,long* len));
  159. extern char* readInitResponseInfo _AP((void** info,char* buffer));
  160.  
  161. extern char* writeSearchInfo _AP((SearchAPDU* query,char* buffer,long* len));
  162. extern char* readSearchInfo _AP((void** info,char* buffer));
  163.  
  164. extern char* writeSearchResponseInfo _AP((SearchResponseAPDU* query,char* buffer,long* len));
  165. extern char* readSearchResponseInfo _AP((void** info,char* buffer));
  166.  
  167. extern char* writePresentInfo _AP((PresentAPDU* present,char* buffer,long* len));
  168. extern char* readPresentInfo _AP((void** info,char* buffer));
  169.  
  170. extern char* writePresentResponseInfo _AP((PresentResponseAPDU* present,char* buffer,long* len));
  171. extern char* readPresentResponseInfo _AP((void** info,char* buffer));
  172.  
  173. #ifdef __cplusplus
  174.     }
  175. #endif /* def __cplusplus */
  176.  
  177. /*----------------------------------------------------------------------*/
  178.  
  179. #endif /* ndef _H_Z39_50 */
  180.  
  181.  
  182.